<%
profile=user.person
-%>

  ID:<%= user.id -%>
  <% if profile -%>
    <%= link_to h(profile.name),profile %>
  <% else -%>
    <span class='none_text'>No profile</span>
  <% end -%>
  
  Status: 
  <% if user.is_admin -%>
    Admin,
  <% end -%>  
  <% if user.can_edit_projects -%>
    Project Editor,
  <% end -%>  
  <% if user.can_edit_institutions -%>
    Institutions Editor
  <% end -%>  
  <% if !user.is_admin && !user.can_edit_projects && !user.can_edit_institutions -%>
    Normal User
  <% end %>  
  
  <% if user.active? %>    
    <% if user.is_admin -%>
      <%= button_to "Revoke Admin Rights", {:controller => "admin", :action => "change_admin_status", :id => user.id, :is_admin => false} -%>
    <% else %>  
      <%= button_to "Grant Admin Rights", {:controller => "admin", :action => "change_admin_status", :id => user.id, :is_admin => true} -%>
    <% end -%>  
  <% else -%>
    <% if user.approved? -%>
      <%= button_to "Resend Activation Email", {:controller => "users", :action => "resend_activation_code", :id => user.id} -%>
      <%= button_to "Activate User", {:controller => "users", :action => "activate", :activation_code => user.activation_code} -%>
    <% else %>       
      <%= button_to "Approve User and Send Activation Email.", {:controller => "users", :action => "approve", :id => user.id} -%>
      <%= button_to "Approve and activate user", {:controller => "users", :action => "approve", :id => user.id, :activate => true} -%>
      <%= button_to "Reject User", {:controller => "users", :action => "reject", :id => user.id} -%>      
    <% end %>  
  <% end -%>    
<br>